package com.network.topo.netwatch;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;

public class Config {

    private BufferedReader configFile;
    
    public Config(String fileName) {
        try {configFile = new BufferedReader(new FileReader(fileName));}
        catch (FileNotFoundException e) {System.out.println(e.getMessage());}
    }
    
    public ArrayList readConfig() {
        ArrayList list = new ArrayList();
        try {
            String s = configFile.readLine();
            while (s != null) {
                String[] c = s.split("/t");
                if (!c[0].startsWith("#")) list.add(c);
                s = configFile.readLine();
            }
            return list;
        }
        catch (Exception e) {System.out.println(e.getMessage());}
        return null;
    }
}
